package com.jiang.core.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * \* 作者: jiang
 * \* 时间: 2021/5/23 17:37
 * \* 描述: 错误码枚举勒, 将小于0的值定义为错误码。给到用户提示
 * \
 */
@Getter
@AllArgsConstructor
public enum ErrorCode {

    SYS_ERROR(-1000, "系统异常"),
    PARAMS_ERROR(-1001, "参数异常"),
    ENTITY_NOT_FOUND(-1002, "数据不存在或已被删除"),

    USER_NOT_LOGIN(-2000, "未登录或超时"),
    USER_NOT_FIND(-2001, "账户不存在"),
    USER_PASSWORD_ERROR(-2002, "账户密码错误"),
    USER_NO_PERMISSION(-2003, "操作权限不足");
    ;

    @JsonValue
    private int value;
    private String desc;
}
